package com.SunSoft.PhoneRemoteControl;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Build;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.Vibrator;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TableLayout;
import android.widget.TableLayout.LayoutParams;
import android.widget.TableRow;
import android.widget.TableRow.LayoutParams;
import android.widget.TextView;
import android.widget.Toast;
import com.baidu.location.k;
import com.tasogo.comm.b;
import com.tasogo.comm.g;
import com.tencent.stat.StatConfig;
import com.tencent.stat.StatService;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Timer;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EncodingUtils;

public class MainControl extends Activity
{
  public static final float[] a = { 0.5F, 0.0F, 0.0F, 0.0F, 2.0F, 0.0F, 0.5F, 0.0F, 0.0F, 2.0F, 0.0F, 0.0F, 0.5F, 0.0F, 2.0F, 0.0F, 0.0F, 0.0F, 0.5F, 0.0F };
  public static final float[] b = { 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F };
  public static ArrayList bx;
  private static com.tasogo.comm.e ci;
  private static Context cm;
  public static boolean d = false;
  public static boolean e = false;
  public static boolean f = true;
  static String g = "探索果智能遥控";
  static String h = "Tasogo Smart Remote";
  static String i = "探索果科技温馨提示";
  static String j = "Tasogo Notice";
  public static boolean k = false;
  public static ArrayList l = new ArrayList();
  e A;
  f B;
  boolean C = true;
  boolean D = false;
  boolean E = true;
  boolean F = false;
  boolean G = false;
  boolean H = false;
  boolean I = true;
  boolean J = false;
  boolean K = false;
  boolean L = false;
  int M = 0;
  int N = 60;
  boolean O = true;
  boolean P = false;
  boolean Q = false;
  fy R;
  TableLayout S;
  int T;
  LinearLayout U;
  LinearLayout V;
  LinearLayout W;
  RelativeLayout X;
  LinearLayout Y;
  LinearLayout Z;
  TextView aA;
  LinearLayout aB;
  LinearLayout aC;
  LinearLayout aD;
  LinearLayout aE;
  LinearLayout aF;
  LinearLayout aG;
  LinearLayout aH;
  LinearLayout aI;
  LinearLayout aJ;
  ImageView aK;
  ImageView aL;
  ImageView aM;
  ImageView aN;
  ImageView aO;
  TextView aP;
  TextView aQ;
  TextView aR;
  TextView aS;
  AlertDialog aT;
  AlertDialog aU;
  boolean aV = false;
  String aW = "";
  String aX;
  String aY;
  boolean aZ = false;
  LinearLayout aa;
  ImageView ab;
  ImageView ac;
  ImageView ad;
  EditText ae;
  EditText af;
  EditText ag;
  TextView ah;
  TextView ai;
  String aj;
  String ak;
  String al = "";
  int am = 0;
  List an = null;
  ImageView ao;
  ImageView ap;
  TextView aq;
  TextView ar;
  TextView as;
  ImageView at;
  LinearLayout au;
  LinearLayout av;
  LinearLayout aw;
  LinearLayout ax;
  LinearLayout ay;
  LinearLayout az;
  String bA;
  byte[] bB;
  int bC = 0;
  int bD = 0;
  ProgressBar bE;
  int bF = 0;
  String bG = "";
  int bH = 0;
  int bI = 0;
  ArrayList bJ = new ArrayList();
  ArrayList bK = new ArrayList();
  int[][] bL;
  int[][] bM;
  int[][] bN;
  String[] bO;
  String[] bP;
  String[] bQ;
  int bR;
  int bS;
  int bT;
  CustomerSpinner[] bU;
  CustomerSpinner[] bV;
  int bW;
  int bX;
  int bY;
  String[] bZ;
  int ba = 0;
  String bb;
  String bc;
  String bd;
  String be;
  String bf;
  int bg = 0;
  String bh = "";
  int bi = 1;
  int bj = 0;
  int bk = 0;
  int bl = 0;
  int bm = 0;
  String[] bn;
  boolean bo = false;
  boolean bp = false;
  int bq = 0;
  boolean br = false;
  boolean bs = false;
  boolean bt = false;
  int bu = 0;
  String bv = "";
  String bw;
  String[] by = new String[24];
  String bz;
  public int c = 47;
  private ProgressDialog cA = null;
  private Dialog cB;
  private ProgressDialog cC = null;
  private String cD;
  private String cE;
  private String cF;
  private String cG;
  private di cH;
  private View.OnTouchListener cI;
  private BroadcastReceiver cJ;
  private View.OnLongClickListener cK;
  private View.OnClickListener cL;
  private View.OnClickListener cM;
  private View.OnTouchListener cN;
  private View.OnClickListener cO;
  private View.OnClickListener cP;
  private View.OnClickListener cQ;
  private View.OnClickListener cR;
  private Runnable cS;
  private Runnable cT;
  private Runnable cU;
  private Runnable cV;
  Handler ca;
  private String cb = i;
  private String cc = g;
  private ArrayAdapter cd;
  private ArrayAdapter ce;
  private String[] cf;
  private String[] cg = { "打开遥控器", "修改遥控信息", "删除遥控信息", "设为默认遥控", "下载到六个遥控器", "自定义布局下载", "清空六个遥控器" };
  private String[] ch = { "探索果音频", "探索果内置", "三星内置安卓4.4以上", "三星内置安卓4.3以下", "小米4内置", "HTC内置" };
  private String cj;
  private int ck = 0;
  private boolean cl = true;
  private String cn = "1.0";
  private SQLiteDatabase co;
  private SQLiteDatabase cp;
  private String cq = "";
  private AudioManager cr;
  private int cs;
  private int ct;
  private int cu;
  private MediaPlayer cv;
  private dh cw;
  private String cx = Environment.getExternalStorageDirectory().getAbsolutePath() + "/test.wav";
  private cw[] cy = new cw[20];
  private com.baidu.location.e cz;
  int m = 0;
  int n = 0;
  boolean o;
  Dialog p;
  AutoCompleteTextView q;
  AutoCompleteTextView r;
  EditText s;
  EditText t;
  TableLayout u;
  String v;
  String w;
  int x = 1;
  int y = 1;
  String z;

  static
  {
    bx = new ArrayList();
  }

  public MainControl()
  {
    int[] arrayOfInt3 = { 1, 6, 4, 7, 3, 5, 9, 10, 11, 12, 13, 14, 2, 8, 26 };
    int[] arrayOfInt4 = { 1, 6, 4, 7, 3, 5, 9, 10, 11, 12, 3, 7, 2, 8, 9 };
    int[] arrayOfInt1 = new int[15];
    arrayOfInt1[0] = 1;
    arrayOfInt1[1] = 2;
    arrayOfInt1[2] = 2;
    arrayOfInt1[3] = 3;
    arrayOfInt1[4] = 4;
    arrayOfInt1[8] = 2;
    arrayOfInt1[9] = 2;
    arrayOfInt1[10] = 4;
    arrayOfInt1[11] = 3;
    int[] arrayOfInt5 = { 2, 7, 8, 5, 6, 3, 1, 9, 7, 8, 6, 5, 10, 3, 1 };
    int[] arrayOfInt6 = { 1, 6, 4, 7, 3, 5, 2, 8, 10, 11, 3, 7, 8, 9, 2 };
    int[] arrayOfInt2 = new int[15];
    arrayOfInt2[0] = 1;
    arrayOfInt2[1] = 2;
    arrayOfInt2[2] = 3;
    arrayOfInt2[3] = 4;
    arrayOfInt2[4] = 5;
    arrayOfInt2[5] = 6;
    this.bL = new int[][] { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, { 1, 10, 11, 4, 3, 12, 2, 7, 8, 6, 5, 9, 13, 14, 29 }, arrayOfInt3, { 1, 8, 6, 9, 5, 7, 12, 13, 10, 11, 3, 4, 2, 7, 29 }, arrayOfInt4, { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, { 1, 11, 15, 16, 17, 12, 2, 10, 6, 4, 3, 7, 8, 13, 14 }, arrayOfInt1, { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, arrayOfInt5, arrayOfInt6, arrayOfInt2 };
    int[] arrayOfInt9 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 };
    int[] arrayOfInt10 = { 1, 10, 11, 4, 3, 12, 2, 7, 8, 6, 5, 9, 13, 14, 29, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 27, 29 };
    int[] arrayOfInt11 = { 1, 11, 12, 14, 13, 5, 9, 10, 6, 4, 3, 7, 2, 8, 26, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 24, 26 };
    arrayOfInt1 = new int[27];
    arrayOfInt1[0] = 1;
    arrayOfInt1[1] = 10;
    arrayOfInt1[2] = 11;
    arrayOfInt1[3] = 4;
    arrayOfInt1[4] = 3;
    arrayOfInt1[5] = 7;
    arrayOfInt1[7] = 13;
    arrayOfInt1[8] = 8;
    arrayOfInt1[9] = 6;
    arrayOfInt1[10] = 5;
    arrayOfInt1[11] = 9;
    arrayOfInt1[12] = 2;
    arrayOfInt1[13] = 14;
    arrayOfInt1[14] = 29;
    arrayOfInt1[15] = 18;
    arrayOfInt1[16] = 19;
    arrayOfInt1[17] = 20;
    arrayOfInt1[18] = 21;
    arrayOfInt1[19] = 22;
    arrayOfInt1[20] = 23;
    arrayOfInt1[21] = 24;
    arrayOfInt1[22] = 25;
    arrayOfInt1[23] = 26;
    arrayOfInt1[24] = 28;
    arrayOfInt1[25] = 27;
    arrayOfInt1[26] = 29;
    arrayOfInt2 = new int[27];
    arrayOfInt2[0] = 1;
    arrayOfInt2[1] = 11;
    arrayOfInt2[2] = 12;
    arrayOfInt2[5] = 5;
    arrayOfInt2[7] = 10;
    arrayOfInt2[8] = 6;
    arrayOfInt2[9] = 4;
    arrayOfInt2[10] = 3;
    arrayOfInt2[11] = 7;
    arrayOfInt2[12] = 2;
    arrayOfInt2[13] = 8;
    arrayOfInt2[14] = 9;
    arrayOfInt2[15] = 18;
    arrayOfInt2[16] = 19;
    arrayOfInt2[17] = 20;
    arrayOfInt2[18] = 21;
    arrayOfInt2[19] = 22;
    arrayOfInt2[20] = 23;
    arrayOfInt2[21] = 24;
    arrayOfInt2[22] = 25;
    arrayOfInt2[23] = 26;
    arrayOfInt2[24] = 28;
    arrayOfInt2[25] = 27;
    arrayOfInt2[26] = 29;
    int[] arrayOfInt12 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 };
    arrayOfInt3 = new int[27];
    arrayOfInt3[0] = 1;
    arrayOfInt3[1] = 11;
    arrayOfInt3[2] = 15;
    arrayOfInt3[3] = 16;
    arrayOfInt3[4] = 17;
    arrayOfInt3[5] = 12;
    arrayOfInt3[6] = 2;
    arrayOfInt3[7] = 10;
    arrayOfInt3[8] = 6;
    arrayOfInt3[9] = 4;
    arrayOfInt3[10] = 3;
    arrayOfInt3[11] = 7;
    arrayOfInt3[12] = 8;
    arrayOfInt3[13] = 12;
    arrayOfInt3[14] = 13;
    arrayOfInt4 = new int[27];
    arrayOfInt4[0] = 1;
    arrayOfInt4[1] = 2;
    arrayOfInt4[2] = 2;
    arrayOfInt4[3] = 3;
    arrayOfInt4[4] = 4;
    arrayOfInt4[8] = 2;
    arrayOfInt4[9] = 2;
    arrayOfInt4[10] = 4;
    arrayOfInt4[11] = 3;
    arrayOfInt5 = new int[27];
    arrayOfInt5[0] = 1;
    arrayOfInt6 = new int[27];
    arrayOfInt6[0] = 2;
    arrayOfInt6[1] = 7;
    arrayOfInt6[2] = 8;
    arrayOfInt6[3] = 5;
    arrayOfInt6[4] = 6;
    arrayOfInt6[5] = 3;
    arrayOfInt6[6] = 10;
    arrayOfInt6[7] = 9;
    arrayOfInt6[8] = 7;
    arrayOfInt6[9] = 8;
    arrayOfInt6[10] = 6;
    arrayOfInt6[11] = 5;
    arrayOfInt6[12] = 1;
    arrayOfInt6[13] = 12;
    arrayOfInt6[14] = 11;
    arrayOfInt6[15] = 15;
    arrayOfInt6[16] = 16;
    arrayOfInt6[17] = 17;
    arrayOfInt6[18] = 18;
    arrayOfInt6[19] = 19;
    arrayOfInt6[20] = 20;
    arrayOfInt6[21] = 21;
    arrayOfInt6[22] = 22;
    arrayOfInt6[23] = 23;
    arrayOfInt6[24] = 24;
    int[] arrayOfInt7 = new int[27];
    arrayOfInt7[0] = 1;
    arrayOfInt7[1] = 10;
    arrayOfInt7[2] = 11;
    arrayOfInt7[5] = 5;
    arrayOfInt7[6] = 2;
    arrayOfInt7[7] = 8;
    arrayOfInt7[8] = 6;
    arrayOfInt7[9] = 4;
    arrayOfInt7[10] = 3;
    arrayOfInt7[11] = 7;
    arrayOfInt7[13] = 9;
    int[] arrayOfInt8 = new int[27];
    arrayOfInt8[0] = 1;
    arrayOfInt8[1] = 2;
    arrayOfInt8[2] = 3;
    arrayOfInt8[3] = 4;
    arrayOfInt8[4] = 5;
    arrayOfInt8[5] = 6;
    this.bM = new int[][] { arrayOfInt9, arrayOfInt10, arrayOfInt11, arrayOfInt1, arrayOfInt2, arrayOfInt12, arrayOfInt3, arrayOfInt4, arrayOfInt5, arrayOfInt6, arrayOfInt7, arrayOfInt8 };
    arrayOfInt9 = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 };
    arrayOfInt10 = new int[] { 1, 8, 6, 9, 5, 12, 2, 7, 10, 11, 3, 4, 13, 14, 29, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 27, 29 };
    arrayOfInt1 = new int[27];
    arrayOfInt1[0] = 1;
    arrayOfInt1[1] = 8;
    arrayOfInt1[2] = 6;
    arrayOfInt1[3] = 9;
    arrayOfInt1[4] = 5;
    arrayOfInt1[5] = 7;
    arrayOfInt1[7] = 13;
    arrayOfInt1[8] = 10;
    arrayOfInt1[9] = 11;
    arrayOfInt1[10] = 3;
    arrayOfInt1[11] = 4;
    arrayOfInt1[12] = 2;
    arrayOfInt1[13] = 14;
    arrayOfInt1[14] = 29;
    arrayOfInt1[15] = 18;
    arrayOfInt1[16] = 19;
    arrayOfInt1[17] = 20;
    arrayOfInt1[18] = 21;
    arrayOfInt1[19] = 22;
    arrayOfInt1[20] = 23;
    arrayOfInt1[21] = 24;
    arrayOfInt1[22] = 25;
    arrayOfInt1[23] = 26;
    arrayOfInt1[24] = 28;
    arrayOfInt1[25] = 27;
    arrayOfInt1[26] = 29;
    arrayOfInt2 = new int[27];
    arrayOfInt2[0] = 1;
    arrayOfInt2[1] = 6;
    arrayOfInt2[2] = 4;
    arrayOfInt2[3] = 7;
    arrayOfInt2[4] = 3;
    arrayOfInt2[5] = 5;
    arrayOfInt2[7] = 10;
    arrayOfInt2[8] = 11;
    arrayOfInt2[9] = 12;
    arrayOfInt2[12] = 2;
    arrayOfInt2[13] = 8;
    arrayOfInt2[14] = 9;
    arrayOfInt2[15] = 18;
    arrayOfInt2[16] = 19;
    arrayOfInt2[17] = 20;
    arrayOfInt2[18] = 21;
    arrayOfInt2[19] = 22;
    arrayOfInt2[20] = 23;
    arrayOfInt2[21] = 24;
    arrayOfInt2[22] = 25;
    arrayOfInt2[23] = 26;
    arrayOfInt2[24] = 28;
    arrayOfInt2[25] = 27;
    arrayOfInt2[26] = 29;
    arrayOfInt11 = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 };
    arrayOfInt3 = new int[27];
    arrayOfInt3[0] = 1;
    arrayOfInt3[1] = 6;
    arrayOfInt3[2] = 4;
    arrayOfInt3[3] = 7;
    arrayOfInt3[4] = 3;
    arrayOfInt3[5] = 12;
    arrayOfInt3[6] = 2;
    arrayOfInt3[7] = 10;
    arrayOfInt3[8] = 11;
    arrayOfInt3[9] = 15;
    arrayOfInt3[10] = 17;
    arrayOfInt3[11] = 16;
    arrayOfInt3[12] = 8;
    arrayOfInt3[13] = 12;
    arrayOfInt3[14] = 13;
    arrayOfInt4 = new int[27];
    arrayOfInt4[0] = 1;
    arrayOfInt4[1] = 2;
    arrayOfInt4[2] = 2;
    arrayOfInt4[3] = 3;
    arrayOfInt4[4] = 4;
    arrayOfInt4[8] = 2;
    arrayOfInt4[9] = 2;
    arrayOfInt4[10] = 4;
    arrayOfInt4[11] = 3;
    arrayOfInt5 = new int[27];
    arrayOfInt5[0] = 1;
    arrayOfInt6 = new int[27];
    arrayOfInt6[0] = 2;
    arrayOfInt6[1] = 7;
    arrayOfInt6[2] = 8;
    arrayOfInt6[3] = 5;
    arrayOfInt6[4] = 6;
    arrayOfInt6[5] = 3;
    arrayOfInt6[6] = 10;
    arrayOfInt6[7] = 9;
    arrayOfInt6[8] = 7;
    arrayOfInt6[9] = 8;
    arrayOfInt6[10] = 6;
    arrayOfInt6[11] = 5;
    arrayOfInt6[12] = 1;
    arrayOfInt6[13] = 12;
    arrayOfInt6[14] = 11;
    arrayOfInt6[15] = 15;
    arrayOfInt6[16] = 16;
    arrayOfInt6[17] = 17;
    arrayOfInt6[18] = 18;
    arrayOfInt6[19] = 19;
    arrayOfInt6[20] = 20;
    arrayOfInt6[21] = 21;
    arrayOfInt6[22] = 22;
    arrayOfInt6[23] = 23;
    arrayOfInt6[24] = 24;
    arrayOfInt7 = new int[27];
    arrayOfInt7[0] = 1;
    arrayOfInt7[1] = 6;
    arrayOfInt7[2] = 4;
    arrayOfInt7[3] = 7;
    arrayOfInt7[4] = 3;
    arrayOfInt7[5] = 5;
    arrayOfInt7[6] = 2;
    arrayOfInt7[7] = 8;
    arrayOfInt7[8] = 10;
    arrayOfInt7[9] = 11;
    arrayOfInt7[13] = 9;
    arrayOfInt8 = new int[27];
    arrayOfInt8[0] = 1;
    arrayOfInt8[1] = 2;
    arrayOfInt8[2] = 3;
    arrayOfInt8[3] = 4;
    arrayOfInt8[4] = 5;
    arrayOfInt8[5] = 6;
    this.bN = new int[][] { arrayOfInt9, arrayOfInt10, { 1, 6, 4, 7, 3, 5, 9, 10, 11, 12, 13, 14, 2, 8, 26, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 24, 26 }, arrayOfInt1, arrayOfInt2, arrayOfInt11, arrayOfInt3, arrayOfInt4, arrayOfInt5, arrayOfInt6, arrayOfInt7, arrayOfInt8 };
    this.bR = 27;
    this.bW = 0;
    this.bX = 0;
    this.bY = 0;
    this.cI = new l(this);
    this.cJ = new aj(this);
    this.cK = new at(this);
    this.cL = new bh(this);
    this.cM = new bt(this);
    this.cN = new ce(this);
    this.cO = new cl(this);
    this.cP = new cm(this);
    this.cQ = new cn(this);
    this.cR = new m(this);
    this.cS = new n(this);
    this.cT = new o(this);
    this.cU = new p(this);
    this.cV = new q(this);
    this.ca = new r(this);
  }

  private static int a(Context paramContext, int paramInt)
  {
    return (int)(0.5F + paramContext.getResources().getDisplayMetrics().density * paramInt);
  }

  public static String a(long paramLong)
  {
    int i1;
    String str2 = "";
    long l1 = paramLong;
    if (paramLong == 0L)
    {
      return "00";
      i1 = (int)l1 % 16;
      switch (i1)
      {
      default:
      case 10:
      case 11:
      case 12:
      case 13:
      case 14:
      case 15:
      }
    }
    for (String str1 = String.valueOf(i1); ; str1 = "F")
      while (true)
      {
        do
        {
          str2 = str1 + str2;
          l1 /= 16L;
        }
        while (l1 > 0L);
        if (str2.length() != 1)
          break label180;
        return "0" + str2;
        str1 = "A";
        continue;
        str1 = "B";
        continue;
        str1 = "C";
        continue;
        str1 = "D";
        continue;
        str1 = "E";
      }
    label180: return str2;
  }

  static String a(String paramString)
  {
    if ((paramString != null) && (!(paramString.equals("null"))))
    {
      str = paramString;
      if (!(paramString.equals("")))
        break label30;
    }
    String str = " ";
    label30: return str;
  }

  private static String a(String paramString, int paramInt1, int paramInt2)
  {
    int i1;
    Object localObject1 = "";
    Object localObject2 = localObject1;
    if (paramString.length() == 8)
    {
      i1 = 0;
      if (i1 < 8)
        break label33;
      localObject2 = localObject1;
    }
    return localObject2;
    if ((i1 == paramInt1) || (i1 == paramInt2))
    {
      label33: localObject2 = localObject1;
      if (i1 == paramInt1)
        localObject2 = localObject1 + paramString.substring(paramInt2, paramInt2 + 1);
      localObject1 = localObject2;
      if (i1 != paramInt2);
    }
    for (localObject1 = localObject2 + paramString.substring(paramInt1, paramInt1 + 1); ; localObject1 = localObject1 + paramString.substring(i1, i1 + 1))
      while (true)
        i1 += 1;
  }

  private void a(View paramView)
  {
    int i1;
    if (paramView.getBackground() != null)
      paramView.getBackground().setCallback(null);
    if (paramView instanceof ViewGroup)
      i1 = 0;
    while (true)
    {
      if (i1 >= ((ViewGroup)paramView).getChildCount())
      {
        ((ViewGroup)paramView).removeAllViews();
        return;
      }
      a(((ViewGroup)paramView).getChildAt(i1));
      i1 += 1;
    }
  }

  private void a(String paramString, int paramInt)
  {
    if ((paramInt != 2) && (!(MyApplication.a().a)) && (!(MyApplication.a().e)) && (MyApplication.a().c))
    {
      MyApplication.a().f = false;
      MyApplication.a().a(true, this);
    }
    if ((this.cu < this.cs - 1) && (!(k)))
      this.cu = (this.cs - 1);
    this.cr.setStreamVolume(3, this.cu, 0);
    Object localObject1 = paramString;
    if (paramString == null)
      localObject1 = "002000FF0000";
    if (((String)localObject1).equals(""));
    for (paramString = "002000FF0000"; ; paramString = (String)localObject1)
    {
      if (paramInt > 0)
        paramString = "05AA55011515153FAD200000FF45BA";
      paramString = di.a(paramString);
      a("Test", "Creat_and_play_file:" + paramString);
      a("Test", "data_start");
      localObject1 = new StringBuilder("");
      ((StringBuilder)localObject1).append(this.bz);
      ((StringBuilder)localObject1).append(g(paramString));
      paramString = ((StringBuilder)localObject1).toString();
      a("Test", "get_code");
      int i1 = paramString.length() / 2 + this.bC;
      localObject1 = b(i1 + 38);
      Object localObject2 = b(i1);
      paramString = "52494646" + ((String)localObject1) + "57415645666D7420" + "120000000100020044AC000010B10200" + "04001000000064617461" + ((String)localObject2) + paramString;
      int i3 = paramString.length() / 2;
      a("Test", "byte_lenth:" + String.valueOf(this.bC + i3));
      localObject1 = new byte[i3];
      int i2 = 0;
      if (i2 >= i3)
      {
        a("Test", "creat_data OK");
        if (paramInt <= 0)
          break label547;
      }
      while (true)
        try
        {
          while (true)
          {
            paramString = new File("/data/data/com.SunSoft.PhoneRemoteControl/tsg_temp.tsg");
            paramString.deleteOnExit();
            localObject2 = new FileOutputStream(paramString);
            ((FileOutputStream)localObject2).write(localObject1);
            ((FileOutputStream)localObject2).write(this.bB);
            ((FileOutputStream)localObject2).flush();
            ((FileOutputStream)localObject2).close();
            a("Test", "save_data OK");
            if (paramInt == 0)
            {
              this.cv.reset();
              this.cv.setLooping(false);
              paramString = new FileInputStream(paramString);
              this.cv.setDataSource(paramString.getFD());
              this.cv.prepare();
              this.cv.start();
              a("Test", "play start OK");
              ((Vibrator)getSystemService("vibrator")).vibrate(new long[] { 10L, 20L, 10L, 20L }, -1);
            }
            return;
            localObject1[i2] = (byte)Integer.parseInt(paramString.substring(i2 * 2, i2 * 2 + 2), 16);
            i2 += 1;
          }
          label547: paramString = new File("/data/data/com.SunSoft.PhoneRemoteControl/tsg_temp_save.png");
        }
        catch (FileNotFoundException paramString)
        {
          paramString.printStackTrace();
          return;
        }
        catch (IOException paramString)
        {
          paramString.printStackTrace();
          return;
        }
    }
  }

  public static void a(String paramString1, String paramString2)
  {
    MyApplication.a();
    MyApplication.a(paramString1, paramString2);
  }

  private static String b(long paramLong)
  {
    String str3 = "";
    String str4 = a(paramLong);
    String str1 = str3;
    String str2 = str4;
    if (str4.length() % 2 != 0)
    {
      str2 = "0" + str4;
      str1 = str3;
    }
    if (str2.length() <= 1);
    while (true)
    {
      while (str1.length() >= 8)
      {
        return str1;
        str1 = str1 + str2.substring(str2.length() - 2);
        str2 = str2.substring(0, str2.length() - 2);
      }
      str1 = str1 + "0";
    }
  }

  static String b(String paramString)
  {
    if ((paramString != null) && (!(paramString.equals("null"))))
    {
      str = paramString;
      if (!(paramString.equals(" ")))
        break label30;
    }
    String str = "";
    label30: return str;
  }

  public static String c()
  {
    String str = "";
    int i1 = 0;
    while (true)
    {
      if (i1 >= 20)
        return str;
      int i2 = (int)(36.0D * Math.random());
      str = str + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".substring(i2, i2 + 1);
      i1 += 1;
    }
  }

  private static String c(int paramInt)
  {
    for (String str = String.valueOf(paramInt); ; str = "0" + str)
      if (str.length() >= 2)
        return str;
  }

  private static String e(String paramString)
  {
    String str2 = "";
    if (paramString == null)
      str1 = "";
    do
    {
      return str1;
      str1 = paramString;
    }
    while (paramString.length() < 2);
    int i1 = 0;
    if (i1 >= paramString.length() / 2)
      return str2;
    String str1 = paramString.substring(i1 * 2, i1 * 2 + 2);
    long l1 = 0L;
    int i2 = 1;
    if (i2 > str1.length())
    {
      l1 = (int)l1;
      str1 = "";
      if (l1 > 0L)
        break label207;
    }
    while (true)
    {
      while (str1.length() >= 8)
      {
        while (true)
        {
          while (true)
          {
            str1 = f(a(a(a(str1, 0, 6), 1, 7), 2, 3));
            str2 = str2 + str1;
            i1 += 1;
          }
          int i3 = "0123456789ABCDEF".indexOf(str1.substring(str1.length() - i2, str1.length() - i2 + 1));
          l1 = ()(l1 + Math.pow(16.0D, i2 - 1) * i3);
          i2 += 1;
        }
        label207: str1 = (l1 % 2L) + str1;
        l1 /= 2L;
      }
      str1 = "0" + str1;
    }
  }

  private static String f(String paramString)
  {
    int i1 = 0;
    int i5 = paramString.length();
    int i2 = 0;
    if (i1 >= paramString.length());
    for (paramString = a(i2); ; paramString = "0" + paramString)
      while (paramString.length() >= 2)
      {
        int i4;
        return paramString;
        int i3 = i2;
        if (paramString.charAt(i1) == '1')
          i4 = i2 + (int)Math.pow(2.0D, i5 - 1 - i1);
        i1 += 1;
        i2 = i4;
      }
  }

  private String g(String paramString)
  {
    paramString = paramString.toUpperCase();
    StringBuilder localStringBuilder = new StringBuilder("");
    while (true)
    {
      if (paramString.length() <= 0)
        return localStringBuilder.toString();
      if (paramString.length() <= 1)
        continue;
      String str = paramString.substring(0, 2);
      int i1 = Integer.parseInt(str.substring(1), 16);
      localStringBuilder.append(this.by[i1]);
      i1 = Integer.parseInt(str.substring(0, 1), 16);
      localStringBuilder.append(this.by[i1]);
      if (paramString.length() == 1)
        paramString = "";
      paramString = paramString.substring(2);
    }
  }

  private static String h(String paramString)
  {
    String str = paramString;
    if (paramString == null)
      str = "";
    return str;
  }

  public static Context i()
  {
    return cm;
  }

  private void k()
  {
    try
    {
      if ((!(MyApplication.a().a)) && (!(MyApplication.a().e)) && (MyApplication.a().c))
      {
        MyApplication.a().f = false;
        MyApplication.a().a(true, this);
      }
      ((Vibrator)getSystemService("vibrator")).vibrate(new long[] { 6L, 10L, 6L, 10L }, -1);
      a("Test", "Play_power_device_type" + String.valueOf(this.ck));
      if (this.ck == 0)
      {
        this.cr.setStreamVolume(3, this.cu, 0);
        if (this.cv == null)
          this.cv = new MediaPlayer();
        this.cv.reset();
        this.cv.setLooping(false);
        FileInputStream localFileInputStream = new FileInputStream(new File("/data/data/com.SunSoft.PhoneRemoteControl/tsg_temp.tsg"));
        this.cv.setDataSource(localFileInputStream.getFD());
        this.cv.prepare();
        this.cv.start();
        return;
      }
      if (this.cj == null)
        this.cj = this.cH.b("");
      try
      {
        if ((this.ck != 1) && (this.ck != 2) && (this.ck != 5) && (this.ck != 3))
          break label332;
        if ((this.ck != 2) || (Build.VERSION.SDK_INT <= 20))
          break label314;
        this.cl = ci.a(this.cj, 2);
        return;
      }
      catch (NullPointerException localNullPointerException)
      {
        this.cl = false;
        return;
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      this.cl = false;
      return;
    }
    label314: this.cl = ci.a(this.cj, 0);
    return;
    if (this.ck != 4)
      label332: return;
    this.cl = ci.a(this.cj, 1);
  }

  private void l()
  {
    int i2 = 0;
    l.clear();
    Object localObject = String.valueOf("");
    localObject = this.co.rawQuery("select ID,define_ID,ico_img,name_ch,name_en ,template_file from control_type where define_ID <> ? order by ID", new String[] { localObject });
    this.cf = new String[((Cursor)localObject).getCount()];
    int i1 = 0;
    if (i1 >= 20)
      i1 = i2;
    while (true)
    {
      while (!(((Cursor)localObject).moveToNext()))
      {
        ((Cursor)localObject).close();
        return;
        this.cy[i1] = new cw(this);
        i1 += 1;
      }
      i2 = ((Cursor)localObject).getInt(((Cursor)localObject).getColumnIndex("ID"));
      ((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex("define_ID"));
      this.cy[i2].a = ((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex("define_ID"));
      this.cy[i2].c = ((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex(this.w));
      this.cy[i2].d = ((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex("name_en"));
      String str = ((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex("ico_img"));
      int i3 = getResources().getIdentifier(str, "drawable", "com.SunSoft.PhoneRemoteControl");
      this.cy[i2].b = i3;
      str = ((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex("template_file"));
      i3 = getResources().getIdentifier(str, "layout", "com.SunSoft.PhoneRemoteControl");
      this.cy[i2].e = i3;
      this.cf[i1] = this.cy[i2].c;
      l.add(this.cy[i2].c);
      i1 += 1;
    }
  }

  private static boolean m()
  {
    Object localObject1 = Environment.getExternalStorageDirectory().getAbsolutePath() + "/tsg_temp.db";
    Object localObject2 = new File("/data/data/com.SunSoft.PhoneRemoteControl/databases/temp_save.dat");
    Object localObject3 = new File((String)localObject1);
    if (((File)localObject3).exists())
      ((File)localObject3).deleteOnExit();
    try
    {
      localObject2 = new FileInputStream((File)localObject2);
      localObject1 = new FileOutputStream((String)localObject1);
      localObject3 = new byte[1024];
      int i1 = ((InputStream)localObject2).read(localObject3);
      if (i1 <= 0)
      {
        ((OutputStream)localObject1).flush();
        ((OutputStream)localObject1).close();
        ((InputStream)localObject2).close();
        return true;
      }
      ((OutputStream)localObject1).write(localObject3, 0, i1);
    }
    catch (FileNotFoundException localFileNotFoundException)
    {
      localFileNotFoundException.printStackTrace();
      return false;
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
    return false;
  }

  private void n()
  {
    int i2 = 0;
    while (true)
    {
      try
      {
        Object localObject;
        InputStreamReader localInputStreamReader = new InputStreamReader(getResources().getAssets().open("tsg_str.tsg"));
        BufferedReader localBufferedReader = new BufferedReader(localInputStreamReader);
        i1 = 0;
        break label156:
        do
        {
          if (!(localBufferedReader.ready()))
          {
            localBufferedReader.close();
            localInputStreamReader.close();
            return;
            this.by[i1] = "";
            i1 += 1;
            break label156:
          }
          localObject = new StringBuilder("");
          ((StringBuilder)localObject).append(localBufferedReader.readLine());
          localObject = EncodingUtils.getString(((StringBuilder)localObject).toString().getBytes(), "UTF-8");
        }
        while (((String)localObject).length() <= 4);
        if (i1 == 0)
        {
          this.by[i1] = ((String)localObject).substring(1);
          break label167:
        }
        this.by[i1] = localObject;
      }
      catch (IOException localIOException)
      {
        localIOException.printStackTrace();
        return;
      }
      label156: if (i1 < 24)
        continue;
      int i1 = i2;
      continue;
      label167: i1 += 1;
    }
  }

  final void a()
  {
    switch (this.y)
    {
    default:
      return;
    case 1:
      this.aq.setTextAppearance(this, 2131034151);
      this.ar.setTextAppearance(this, 2131034150);
      this.as.setTextAppearance(this, 2131034150);
      this.aq.setBackgroundColor(Color.rgb(70, 66, 63));
      this.ar.setBackgroundColor(Color.rgb(43, 39, 36));
      this.as.setBackgroundColor(Color.rgb(43, 39, 36));
      this.U.setVisibility(0);
      this.V.setVisibility(8);
      this.W.setVisibility(8);
      this.aA.setText(this.cc + "-" + getString(2131099808));
      b();
      return;
    case 2:
      this.aq.setTextAppearance(this, 2131034150);
      this.ar.setTextAppearance(this, 2131034151);
      this.as.setTextAppearance(this, 2131034150);
      this.aq.setBackgroundColor(Color.rgb(43, 39, 36));
      this.ar.setBackgroundColor(Color.rgb(70, 66, 63));
      this.as.setBackgroundColor(Color.rgb(43, 39, 36));
      this.U.setVisibility(8);
      this.V.setVisibility(0);
      this.W.setVisibility(8);
      this.aA.setText(this.cc + "-" + getString(2131099809));
      return;
    case 3:
    }
    this.aq.setTextAppearance(this, 2131034150);
    this.ar.setTextAppearance(this, 2131034150);
    this.as.setTextAppearance(this, 2131034151);
    this.aq.setBackgroundColor(Color.rgb(43, 39, 36));
    this.ar.setBackgroundColor(Color.rgb(43, 39, 36));
    this.as.setBackgroundColor(Color.rgb(70, 66, 63));
    this.U.setVisibility(8);
    this.V.setVisibility(8);
    this.W.setVisibility(0);
    this.aA.setText(this.cc + "-" + getString(2131099810));
    Message localMessage = new Message();
    localMessage.what = 11;
    this.ca.sendMessage(localMessage);
  }

  final void a(int paramInt)
  {
    this.aj = this.cw.a("save_user");
    this.ak = this.cw.a("save_pass");
    this.ae.setText(this.aj);
    this.af.setText(this.ak);
    if (!(this.aj.equals("")))
    {
      i1 = paramInt;
      if (!(this.ak.equals("")))
        break label87;
    }
    int i1 = paramInt;
    if (paramInt == 3)
      i1 = 1;
    switch (i1)
    {
    default:
      return;
    case 1:
      this.P = false;
      this.ad.setVisibility(8);
      this.ac.setVisibility(0);
      this.ab.setVisibility(0);
      this.aa.setVisibility(8);
      this.Z.setVisibility(8);
      this.Y.setVisibility(0);
      this.ae.setText(this.aj);
      this.af.setText(this.ak);
      this.ag.setText("");
      this.ah.setText("");
      this.ai.setText(getString(2131099820));
      this.aV = false;
      return;
    case 2:
      this.P = true;
      this.ad.setVisibility(0);
      this.ab.setVisibility(8);
      this.aa.setVisibility(0);
      this.Z.setVisibility(8);
      this.Y.setVisibility(0);
      this.ae.setText(this.aj);
      this.af.setText("");
      this.ag.setText("");
      this.ah.setText("");
      this.ai.setText(getString(2131099820));
      this.aV = false;
      return;
    case 3:
      label87: this.Z.setVisibility(0);
      this.Y.setVisibility(8);
      this.ai.setText(this.aj + getString(2131099821));
      this.aV = true;
      return;
    case 4:
    }
    this.ad.setVisibility(8);
    this.ac.setVisibility(0);
    this.ab.setVisibility(0);
    this.aa.setVisibility(8);
    this.Z.setVisibility(8);
    this.Y.setVisibility(0);
    this.ae.setText(this.aj);
    this.af.setText("");
    this.ag.setText("");
    this.ah.setText("");
    this.ai.setText(getString(2131099820));
    this.aV = false;
  }

  protected final void a(boolean paramBoolean)
  {
    int i2;
    int i3;
    Object localObject = LayoutInflater.from(this).inflate(2130903044, null);
    EditText localEditText1 = (EditText)((View)localObject).findViewById(2131165232);
    EditText localEditText2 = (EditText)((View)localObject).findViewById(2131165399);
    AutoCompleteTextView localAutoCompleteTextView1 = (AutoCompleteTextView)((View)localObject).findViewById(2131165233);
    AutoCompleteTextView localAutoCompleteTextView2 = (AutoCompleteTextView)((View)localObject).findViewById(2131165400);
    LinearLayout localLinearLayout1 = (LinearLayout)((View)localObject).findViewById(2131165388);
    LinearLayout localLinearLayout2 = (LinearLayout)((View)localObject).findViewById(2131165387);
    ImageView localImageView = (ImageView)((View)localObject).findViewById(2131165398);
    EditText localEditText3 = (EditText)((View)localObject).findViewById(2131165236);
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    CustomerSpinner localCustomerSpinner = (CustomerSpinner)((View)localObject).findViewById(2131165231);
    TextView localTextView = (TextView)((View)localObject).findViewById(2131165245);
    if (!(d))
    {
      if (!(this.C))
        break label630;
      localLinearLayout2.setVisibility(0);
      localLinearLayout1.setVisibility(8);
    }
    this.o = paramBoolean;
    this.q = localAutoCompleteTextView1;
    this.r = localAutoCompleteTextView2;
    this.s = localEditText1;
    this.t = localEditText2;
    localBuilder.setIcon(17301659);
    localBuilder.setView((View)localObject);
    localAutoCompleteTextView1.setAdapter(this.cd);
    localAutoCompleteTextView2.setAdapter(this.ce);
    localCustomerSpinner.a(l);
    localCustomerSpinner.setOnItemSelectedListener(new be(this, localEditText1, localEditText2, localAutoCompleteTextView1, localAutoCompleteTextView2));
    localImageView.setOnClickListener(new bf(this));
    int i1 = 0;
    if (!(paramBoolean))
    {
      localObject = new String[1];
      localObject[0] = String.valueOf(this.T);
      if (d)
      {
        localObject = this.co.rawQuery("select ID,control_type,name_ch,come_from,name_en,brand_ch,brand_en,control_model  from control_list where ID = ?", localObject);
        if (((Cursor)localObject).moveToNext())
        {
          i3 = ((Cursor)localObject).getInt(((Cursor)localObject).getColumnIndex("control_type"));
          localEditText1.setText(((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex("name_ch")));
          localEditText2.setText(((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex("name_en")));
          localAutoCompleteTextView1.setText(((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex("brand_ch")));
          localAutoCompleteTextView2.setText(((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex("brand_en")));
          localEditText3.setText(((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex("control_model")));
          i1 = ((Cursor)localObject).getInt(((Cursor)localObject).getColumnIndex("come_from"));
          i2 = 0;
          if (i2 < this.cf.length)
            break label663;
        }
        ((Cursor)localObject).close();
        localCustomerSpinner.setBackgroundResource(2130837521);
        localCustomerSpinner.setEnabled(false);
        if ((!(d)) && (!(e)) && (i1 == 1))
        {
          localEditText3.setBackgroundResource(2130837521);
          localEditText3.setEnabled(false);
        }
        localTextView.setVisibility(8);
        localBuilder.setTitle(getString(2131099800));
        localBuilder.setPositiveButton(getString(2131099653), new bg(this, localEditText1, localAutoCompleteTextView1, localEditText2, localAutoCompleteTextView2, localEditText3));
      }
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              localBuilder.setNegativeButton(getString(2131099654), new bm(this));
              this.p = localBuilder.show();
              return;
              label630: localLinearLayout1.setVisibility(0);
              localLinearLayout2.setVisibility(8);
            }
            localObject = this.cp.rawQuery("select ID,control_type,name_ch,come_from,name_en,brand_ch,brand_en,control_model  from control_list where ID = ?", localObject);
          }
          label663: if (!(this.cf[i2].equals(this.cy[i3].c)))
            break;
          localCustomerSpinner.setSelection(i2);
        }
        i2 += 1;
      }
      localBuilder.setTitle(getString(2131099801));
      localCustomerSpinner.setEnabled(true);
      localBuilder.setPositiveButton(getString(2131099653), new bl(this, localEditText1, localEditText2, localAutoCompleteTextView1, localAutoCompleteTextView2, localEditText3));
    }
  }

  final void b()
  {
    TableLayout.LayoutParams localLayoutParams1;
    TableLayout.LayoutParams localLayoutParams2;
    TableRow.LayoutParams localLayoutParams3;
    TableRow.LayoutParams localLayoutParams4;
    TableRow.LayoutParams localLayoutParams5;
    TableRow.LayoutParams localLayoutParams6;
    this.u.removeAllViews();
    Object localObject1 = new String[1];
    localObject1[0] = String.valueOf("9");
    if (d)
      if (this.bG.equals(""))
      {
        localObject1 = this.co.rawQuery("select ID,control_type,name_ch,name_en,brand_ch,brand_en  from control_list where come_from <> ? and control_type<>5 order by come_from desc,ID desc", localObject1);
        if (((Cursor)localObject1).getCount() <= 0)
          break label930;
        this.X.setVisibility(8);
        this.u.setVisibility(0);
        localLayoutParams1 = new TableLayout.LayoutParams();
        localLayoutParams1.width = -1;
        localLayoutParams1.height = a(this, 110);
        localLayoutParams2 = new TableLayout.LayoutParams();
        localLayoutParams2.width = -1;
        localLayoutParams2.height = a(this, 1);
        localLayoutParams3 = new TableRow.LayoutParams();
        localLayoutParams3.width = a(this, 180);
        localLayoutParams3.height = a(this, 30);
        localLayoutParams3.gravity = 16;
        localLayoutParams4 = new TableRow.LayoutParams();
        localLayoutParams4.width = a(this, 180);
        localLayoutParams4.height = a(this, 30);
        localLayoutParams4.gravity = 16;
        localLayoutParams5 = new TableRow.LayoutParams();
        localLayoutParams5.width = a(this, 70);
        localLayoutParams5.height = a(this, 70);
        localLayoutParams5.rightMargin = a(this, 6);
        localLayoutParams5.gravity = 16;
        localLayoutParams6 = new TableRow.LayoutParams();
        localLayoutParams6.width = a(this, 35);
        localLayoutParams6.height = a(this, 35);
        localLayoutParams6.gravity = 16;
        this.br = false;
        if (((Cursor)localObject1).moveToNext())
          break label453;
      }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          ((Cursor)localObject1).close();
          return;
          localObject1 = " and (control_model  like '%" + this.bG + "%' or  " + this.v + " like '%" + this.bG + "%'   or  " + this.w + " like '%" + this.bG + "%') ";
          localObject1 = this.co.rawQuery("select ID,control_type,name_ch,name_en,brand_ch,brand_en,control_model from control_list where control_type != ? " + ((String)localObject1) + " order by name_ch ", new String[] { "5" });
        }
        localObject1 = this.cp.rawQuery("select ID,control_type,name_ch,name_en,brand_ch,brand_en  from control_list where come_from <> ? order by come_from desc,ID desc", localObject1);
      }
      label453: int i1 = ((Cursor)localObject1).getInt(((Cursor)localObject1).getColumnIndex("ID"));
      int i2 = ((Cursor)localObject1).getInt(((Cursor)localObject1).getColumnIndex("control_type"));
      if (this.bq == i1)
        this.br = true;
      Object localObject2 = new TableRow(this);
      TextView localTextView1 = new TextView(this);
      TextView localTextView2 = new TextView(this);
      LinearLayout localLinearLayout = new LinearLayout(this);
      ImageView localImageView1 = new ImageView(this);
      ImageView localImageView2 = new ImageView(this);
      ((TableRow)localObject2).setLayoutParams(localLayoutParams1);
      localTextView1.setText(((Cursor)localObject1).getString(((Cursor)localObject1).getColumnIndex(this.w)));
      localTextView2.setText(((Cursor)localObject1).getString(((Cursor)localObject1).getColumnIndex(this.v)));
      localLinearLayout.setOrientation(1);
      localLinearLayout.setPadding(0, a(this, 13), 0, a(this, 7));
      localLinearLayout.addView(localTextView1);
      localLinearLayout.addView(localTextView2);
      localImageView1.setImageResource(this.cy[i2].b);
      localImageView1.setLayoutParams(localLayoutParams5);
      localImageView2.setImageResource(2130837515);
      localImageView2.setLayoutParams(localLayoutParams6);
      localTextView1.setLayoutParams(localLayoutParams3);
      localTextView1.setGravity(19);
      localTextView2.setLayoutParams(localLayoutParams4);
      localTextView2.setGravity(19);
      localTextView1.setTextAppearance(this, 2131034122);
      localTextView2.setTextAppearance(this, 2131034134);
      localTextView1.setTag(Integer.valueOf(i1));
      localTextView2.setTag(Integer.valueOf(i1));
      localImageView1.setTag(Integer.valueOf(i1));
      localImageView2.setTag(Integer.valueOf(i1));
      localLinearLayout.setTag(Integer.valueOf(i1));
      localTextView1.setOnClickListener(this.cR);
      localTextView2.setOnClickListener(this.cR);
      localLinearLayout.setOnClickListener(this.cR);
      localImageView1.setOnClickListener(this.cR);
      if (d)
      {
        localTextView1.setOnLongClickListener(this.cK);
        localTextView2.setOnLongClickListener(this.cK);
      }
      while (true)
      {
        while (true)
        {
          ((TableRow)localObject2).addView(localImageView1);
          ((TableRow)localObject2).addView(localLinearLayout);
          ((TableRow)localObject2).addView(localImageView2);
          this.u.addView((View)localObject2, new TableRow.LayoutParams());
          localObject2 = new View(this);
          ((View)localObject2).setLayoutParams(localLayoutParams2);
          ((View)localObject2).setBackgroundColor(Color.rgb(183, 183, 183));
          this.u.addView((View)localObject2, localLayoutParams2);
        }
        localImageView2.setOnClickListener(this.cL);
      }
      label930: this.X.setVisibility(0);
      this.u.setVisibility(8);
    }
  }

  public final void b(int paramInt)
  {
    int i1 = 0;
    Object localObject = String.valueOf("");
    localObject = this.co.rawQuery("select ID,brand_ch,brand_en ,control_type from brand_list where control_type=? and brand_ch<>? order by brand_ch", new String[] { String.valueOf(paramInt), localObject });
    paramInt = ((Cursor)localObject).getCount();
    String[] arrayOfString1 = new String[paramInt];
    String[] arrayOfString2 = new String[paramInt];
    paramInt = i1;
    while (true)
    {
      if (!(((Cursor)localObject).moveToNext()))
      {
        ((Cursor)localObject).close();
        this.cd = new ArrayAdapter(this, 17367057, arrayOfString1);
        this.ce = new ArrayAdapter(this, 17367057, arrayOfString2);
        return;
      }
      arrayOfString1[paramInt] = ((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex("brand_ch"));
      arrayOfString2[paramInt] = ((Cursor)localObject).getString(((Cursor)localObject).getColumnIndex("brand_en"));
      paramInt += 1;
    }
  }

  public final void c(String paramString)
  {
    Object localObject1 = this.cw.a("db_v");
    int i4 = 0;
    try
    {
      float f1;
      float f2;
      int i1;
      Object localObject2;
      paramString = paramString.split("\\|");
      if (paramString.length > 6)
        localObject2 = getPackageManager();
      try
      {
        this.cn = ((PackageManager)localObject2).getPackageInfo(getPackageName(), 0).versionName;
        localObject2 = this.cn.split("\\.");
        i1 = 0;
        f1 = 0.0F;
        if (i1 < localObject2.length)
          break label500;
        f2 = 0.0F;
        localObject2 = paramString[0].split("\\.");
        i1 = 0;
        if (i1 < localObject2.length)
          break label536;
        a("Test", "cur_f:" + String.valueOf(f1));
        a("Test", "get_f:" + String.valueOf(f2));
        if (f2 <= f1)
          break label572;
        this.cw.a("has_new_soft", "YES");
        localObject2 = new Message();
        ((Message)localObject2).what = 11;
        this.ca.sendMessage((Message)localObject2);
        Toast.makeText(this, getString(2131099837), 1).show();
        i1 = 1;
        this.cq = paramString[6];
        i4 = Integer.valueOf((String)localObject1).intValue();
        if (Integer.valueOf(this.cq).intValue() <= i4)
          break label592;
        this.cw.a("has_new_data", "YES");
        localObject1 = new Message();
        ((Message)localObject1).what = 11;
        this.ca.sendMessage((Message)localObject1);
        if (i1 == 0)
          Toast.makeText(this, getString(2131099838), 1).show();
        this.cD = this.cw.a("last_ad_time");
        if ((this.cD.equals(paramString[3])) || (paramString[3].equals("2014-03-16 09:21:15")))
          break label608;
        this.cE = paramString[3];
        this.cF = paramString[4];
        this.cG = paramString[5];
        paramString = new AlertDialog.Builder(cm);
        paramString.setTitle(cm.getString(2131099670));
        paramString.setMessage(this.cF);
        paramString.setNeutralButton(cm.getString(2131099655), new bz(this));
        if (this.cG.startsWith("http"))
          paramString.setPositiveButton(cm.getString(2131099660), new ca(this));
        paramString.setNegativeButton(cm.getString(2131099661), new cb(this));
        paramString.show();
        label536: label572: label592: label608: label500: return;
      }
      catch (PackageManager.NameNotFoundException localNameNotFoundException)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              int i2;
              while (true)
              {
                while (true)
                  this.cn = "1.0";
                f1 = (float)(f1 + Float.valueOf(localNameNotFoundException[i1]).floatValue() / Math.pow(10.0D, i1));
                i1 += 1;
              }
              f2 = (float)(f2 + Float.valueOf(localNameNotFoundException[i2]).floatValue() / Math.pow(10.0D, i2));
              i2 += 1;
            }
            this.cw.a("has_new_soft", "");
            int i3 = i4;
          }
          this.cw.a("has_new_data", "");
        }
        return;
      }
    }
    catch (Exception paramString)
    {
    }
  }

  public final String d(String paramString)
  {
    try
    {
      InputStreamReader localInputStreamReader = new InputStreamReader(getResources().getAssets().open(paramString));
      BufferedReader localBufferedReader = new BufferedReader(localInputStreamReader);
      paramString = "";
      String str = localBufferedReader.readLine();
      if (str == null)
      {
        localInputStreamReader.close();
        return paramString;
      }
      paramString = paramString + str;
    }
    catch (Exception paramString)
    {
      paramString.printStackTrace();
    }
    return "";
  }

  protected final void d()
  {
    int i1;
    Object localObject4;
    Object localObject3 = LayoutInflater.from(this).inflate(2130903071, null);
    TableLayout localTableLayout = (TableLayout)((View)localObject3).findViewById(2131165210);
    Object localObject1 = (TextView)((View)localObject3).findViewById(2131165432);
    Object localObject2 = (ImageView)((View)localObject3).findViewById(2131165431);
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setView((View)localObject3);
    try
    {
      localObject3 = getAssets().open("temp.tsg");
      localObject4 = Drawable.createFromStream((InputStream)localObject3, null);
      if (localObject4 != null)
        ((ImageView)localObject2).setImageDrawable((Drawable)localObject4);
      localObject4 = new TableLayout.LayoutParams();
      ((TableLayout.LayoutParams)localObject4).width = a(this, 120);
      ((TableLayout.LayoutParams)localObject4).height = a(this, 60);
      ((ImageView)localObject2).setLayoutParams((ViewGroup.LayoutParams)localObject4);
      ((InputStream)localObject3).close();
      ((ImageView)localObject2).setOnClickListener(new ap(this));
      if (!(this.C))
        break label438;
      localBuilder.setTitle("探索果科技版权所有");
      ((TextView)localObject1).setText("\n战略合作伙伴(随机排名):");
      localTableLayout.removeAllViews();
      localObject1 = new TableLayout.LayoutParams();
      ((TableLayout.LayoutParams)localObject1).width = -1;
      ((TableLayout.LayoutParams)localObject1).height = a(this, 3);
      localObject2 = new TableRow.LayoutParams();
      ((TableRow.LayoutParams)localObject2).width = a(this, 120);
      ((TableRow.LayoutParams)localObject2).height = a(this, 60);
      localObject3 = new String[6][];
      localObject3[0] = { "dmzer", "" };
      localObject3[1] = { "ssk", "http://www.ssk.cn/" };
      localObject3[2] = { "remax", "http://www.iremax.hk/" };
      localObject3[3] = { "moodrr", "http://www.moodrr.com/" };
      localObject3[4] = { "broadin", "http://www.broadin.cn/" };
      localObject3[5] = { "jiachang", "http://www.51jiachang.com/" };
      localObject4 = new int[6];
      i1 = 0;
      if (i1 < 6)
        break label458;
      i1 = 0;
      if (i1 < 6)
        break label471;
      i1 = 0;
      if (i1 < 6)
        break label526;
      localBuilder.setPositiveButton(getString(2131099653), new aq(this));
      localBuilder.show();
      label526: label438: label458: label471: return;
    }
    catch (IOException localIOException)
    {
      while (true)
      {
        while (true)
        {
          while (true)
            localIOException.printStackTrace();
          localBuilder.setTitle("All Rights Reserved For Tasogo");
          ((TextView)localObject1).setText("\nOur Cooperators:");
        }
        localObject4[i1] = 100;
        i1 += 1;
      }
      int i4 = (int)(6.0D * Math.random());
      int i3 = 0;
      int i2 = 0;
      while (true)
      {
        while (i2 >= 6)
        {
          if (i3 == 0);
          localObject4[i1] = i4;
          i1 += 1;
        }
        if (localObject4[i2] == i4)
          i3 = 1;
        i2 += 1;
      }
      i2 = localObject4[i1];
      Object localObject5 = new TableRow(this);
      ImageView localImageView = new ImageView(this);
      localImageView.setImageResource(getResources().getIdentifier(localIOException[i2][0], "drawable", "com.SunSoft.PhoneRemoteControl"));
      localImageView.setLayoutParams((ViewGroup.LayoutParams)localObject2);
      localImageView.setTag(localIOException[i2][1]);
      localImageView.setOnClickListener(this.cM);
      ((TableRow)localObject5).addView(localImageView);
      localTableLayout.addView((View)localObject5, new TableLayout.LayoutParams());
      localObject5 = new View(this);
      ((View)localObject5).setLayoutParams((ViewGroup.LayoutParams)localObject1);
      ((View)localObject5).setBackgroundColor(Color.rgb(0, 0, 0));
      localTableLayout.addView((View)localObject5, (ViewGroup.LayoutParams)localObject1);
      i1 += 1;
    }
  }

  protected final void e()
  {
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setTitle(getString(2131099822));
    localBuilder.setMessage(getString(2131099823));
    localBuilder.setOnKeyListener(new ar(this));
    localBuilder.setPositiveButton(getString(2131099657), new as(this));
    localBuilder.setNegativeButton(getString(2131099655), new ax(this));
    localBuilder.setNeutralButton(getString(2131099876), new ay(this));
    localBuilder.show();
  }

  protected final void f()
  {
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setTitle(getString(2131099858)).setIcon(17301659).setSingleChoiceItems(this.ch, this.ck, new bc(this));
    localBuilder.setNegativeButton(getString(2131099863), new bd(this));
    localBuilder.show();
  }

  protected final void g()
  {
    Object localObject = LayoutInflater.from(this).inflate(2130903080, null);
    TextView localTextView1 = (TextView)((View)localObject).findViewById(2131165437);
    TextView localTextView2 = (TextView)((View)localObject).findViewById(2131165438);
    TextView localTextView3 = (TextView)((View)localObject).findViewById(2131165439);
    TextView localTextView4 = (TextView)((View)localObject).findViewById(2131165440);
    ((View)localObject).findViewById(2131165245);
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setView((View)localObject);
    localBuilder.setTitle(this.aj + getString(2131099757));
    this.bd = this.cw.a("save_info");
    if (this.bd != null)
    {
      localObject = this.bd.split("\\|");
      if ((localObject != null) && (localObject.length == 6))
      {
        localTextView1.setText(localObject[1]);
        localTextView2.setText(localObject[2]);
        localTextView3.setText(localObject[3]);
        localTextView4.setText(localObject[4]);
      }
    }
    localBuilder.setPositiveButton(getString(2131099651), new bp(this, localTextView1, localTextView2, localTextView3, localTextView4));
    localBuilder.setNegativeButton(getString(2131099654), new bq(this));
    this.aT = localBuilder.show();
  }

  protected final void h()
  {
    Object localObject3 = LayoutInflater.from(this).inflate(2130903081, null);
    TextView localTextView1 = (TextView)((View)localObject3).findViewById(2131165441);
    TextView localTextView2 = (TextView)((View)localObject3).findViewById(2131165443);
    Object localObject1 = (CustomerSpinner)((View)localObject3).findViewById(2131165442);
    Object localObject2 = (LinearLayout)((View)localObject3).findViewById(2131165444);
    TextView localTextView4 = (TextView)((View)localObject3).findViewById(2131165445);
    TextView localTextView3 = (TextView)((View)localObject3).findViewById(2131165245);
    bx.clear();
    if (this.C)
    {
      i1 = 0;
      while (true)
      {
        if (i1 >= 5)
        {
          ((CustomerSpinner)localObject1).a(bx);
          ((CustomerSpinner)localObject1).setOnItemSelectedListener(new br(this));
          AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
          localBuilder.setView((View)localObject3);
          localBuilder.setTitle(this.aj + "," + getString(2131099833));
          ((LinearLayout)localObject2).setVisibility(8);
          if ((this.bw == null) || (this.bw.equals("")))
            this.bw = this.cw.a("feedback_info");
          if ((this.bw != null) && (!(this.bw.equals(""))))
          {
            localObject3 = this.bw.split("\\|\\|");
            if (localObject3.length > 6)
            {
              this.bs = localObject3[6].equals("1");
              this.bt = localObject3[9].equals("1");
              this.bv = localObject3[5] + "||" + localObject3[2] + "||" + localObject3[3];
              localTextView1.setText(localObject3[5]);
              localTextView2.setText(localObject3[3]);
              ((CustomerSpinner)localObject1).setSelection(Integer.valueOf(localObject3[2]).intValue());
              if (this.bs)
              {
                ((LinearLayout)localObject2).setVisibility(0);
                localTextView4.setText(localObject3[7] + "\n" + localObject3[8]);
                if (!(this.bt))
                {
                  localTextView4.setTextColor(-65536);
                  localObject2 = new Message();
                  ((Message)localObject2).what = 21;
                  this.ca.sendMessage((Message)localObject2);
                }
              }
            }
          }
          if ((this.bv != null) && (!(this.bv.equals(""))))
          {
            localObject2 = this.bv.split("\\|\\|");
            if (localObject2.length > 2)
            {
              localTextView1.setText(localObject2[0]);
              localTextView2.setText(localObject2[2]);
              ((CustomerSpinner)localObject1).setSelection(Integer.valueOf(localObject2[1]).intValue());
            }
          }
          this.bd = this.cw.a("save_info");
          if (this.bd != null)
          {
            localObject1 = this.bd.split("\\|");
            if ((localObject1 != null) && (localObject1.length == 6) && (localObject1[2] != null))
              localTextView1.setText(localObject1[2]);
          }
          localBuilder.setPositiveButton(getString(2131099656), new bs(this, localTextView1, localTextView2, localTextView3));
          localBuilder.setNegativeButton(getString(2131099654), new bu(this));
          this.aT = localBuilder.show();
          return;
        }
        bx.add(new String[] { "遥控硬件测试灯不闪", "灯闪,全部家电者不能控制", "部分家电不能控制", "APP改进建议", "其它" }[i1]);
        i1 += 1;
      }
    }
    int i1 = 0;
    while (true)
    {
      if (i1 < 5);
      bx.add(new String[] { "Light does not flash", "All devices cannot control", "Some devices cannot control", "APP design suggestions", "Other" }[i1]);
      i1 += 1;
    }
  }

  public void onCreate(Bundle paramBundle)
  {
    int i1;
    int i2;
    super.onCreate(paramBundle);
    cm = this;
    setContentView(2130903042);
    this.C = Locale.getDefault().getLanguage().toString().equals("zh");
    this.aA = ((TextView)findViewById(2131165185));
    if (this.C)
    {
      this.cb = i;
      this.v = "brand_ch";
      this.w = "name_ch";
      this.cc = g;
      this.aA.setText(this.cc + "-" + getString(2131099808));
      paramBundle = getPackageManager();
    }
    try
    {
      this.cn = paramBundle.getPackageInfo(getPackageName(), 0).versionName;
      this.cw = new dh(this);
      this.cH = new di();
      this.cr = ((AudioManager)getSystemService("audio"));
      this.cs = this.cr.getStreamMaxVolume(3);
      this.ct = this.cr.getStreamVolume(3);
      paramBundle = this.cw.a("save_vol");
      a("Test", "get_vol:" + paramBundle);
      if (paramBundle.equals(""))
      {
        this.cu = this.cs;
        if ((this.cu < this.cs - 1) && (!(k)))
          this.cu = (this.cs - 1);
        this.cr.setStreamVolume(3, this.cu, 0);
        this.u = ((TableLayout)findViewById(2131165204));
        this.S = ((TableLayout)findViewById(2131165210));
        this.aq = ((TextView)findViewById(2131165223));
        this.ar = ((TextView)findViewById(2131165224));
        this.as = ((TextView)findViewById(2131165225));
        this.aq.setOnClickListener(this.cO);
        this.ar.setOnClickListener(this.cO);
        this.as.setOnClickListener(this.cO);
        this.U = ((LinearLayout)findViewById(2131165203));
        this.V = ((LinearLayout)findViewById(2131165205));
        this.W = ((LinearLayout)findViewById(2131165212));
        this.X = ((RelativeLayout)findViewById(2131165209));
        this.ap = ((ImageView)findViewById(2131165351));
        this.ap.setOnTouchListener(this.cI);
        this.ao = ((ImageView)findViewById(2131165211));
        this.ao.setOnClickListener(new af(this));
        ((ImageView)findViewById(2131165352)).setOnClickListener(new ag(this));
        float f1 = getResources().getDisplayMetrics().density;
        paramBundle = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(paramBundle);
        i1 = (int)(paramBundle.heightPixels / f1 + 0.5F) - 130;
        paramBundle = new RelativeLayout.LayoutParams(-2, -2);
        paramBundle.width = a(this, (int)(0.5F + i1 * 224 / 510));
        paramBundle.addRule(14, 1);
        paramBundle.topMargin = a(this, (int)(i1 * 354 / 510 + 0.5F));
        this.ap.setLayoutParams(paramBundle);
        this.aB = ((LinearLayout)findViewById(2131165384));
        this.aC = ((LinearLayout)findViewById(2131165382));
        this.aK = ((ImageView)findViewById(2131165371));
        this.aL = ((ImageView)findViewById(2131165370));
        this.aD = ((LinearLayout)findViewById(2131165383));
        this.aE = ((LinearLayout)findViewById(2131165377));
        this.aF = ((LinearLayout)findViewById(2131165379));
        this.aG = ((LinearLayout)findViewById(2131165375));
        this.aH = ((LinearLayout)findViewById(2131165386));
        this.aM = ((ImageView)findViewById(2131165372));
        this.aI = ((LinearLayout)findViewById(2131165385));
        this.aJ = ((LinearLayout)findViewById(2131165381));
        this.aN = ((ImageView)findViewById(2131165373));
        this.aO = ((ImageView)findViewById(2131165374));
        this.aQ = ((TextView)findViewById(2131165378));
        this.aP = ((TextView)findViewById(2131165380));
        this.aR = ((TextView)findViewById(2131165368));
        this.aS = ((TextView)findViewById(2131165376));
        this.aB.setOnClickListener(this.cQ);
        this.aC.setOnClickListener(this.cQ);
        this.aK.setOnClickListener(this.cQ);
        this.aL.setOnClickListener(this.cQ);
        this.aD.setOnClickListener(this.cQ);
        this.aE.setOnClickListener(this.cQ);
        this.aF.setOnClickListener(this.cQ);
        this.aG.setOnClickListener(this.cQ);
        this.aH.setOnClickListener(this.cQ);
        this.aM.setOnClickListener(this.cQ);
        this.aI.setOnClickListener(this.cQ);
        this.aJ.setOnClickListener(this.cQ);
        this.aN.setOnClickListener(this.cQ);
        this.aO.setOnClickListener(this.cQ);
        this.au = ((LinearLayout)findViewById(2131165363));
        this.av = ((LinearLayout)findViewById(2131165364));
        this.aw = ((LinearLayout)findViewById(2131165367));
        this.ax = ((LinearLayout)findViewById(2131165365));
        this.ay = ((LinearLayout)findViewById(2131165366));
        this.az = ((LinearLayout)findViewById(2131165369));
        this.at = ((ImageView)findViewById(2131165201));
        this.au.setOnClickListener(this.cP);
        this.av.setOnClickListener(this.cP);
        this.aw.setOnClickListener(this.cP);
        this.ax.setOnClickListener(this.cP);
        this.ay.setOnClickListener(this.cP);
        this.az.setOnClickListener(this.cP);
        this.Y = ((LinearLayout)findViewById(2131165354));
        this.aa = ((LinearLayout)findViewById(2131165356));
        this.Z = ((LinearLayout)findViewById(2131165362));
        this.ae = ((EditText)findViewById(2131165228));
        this.af = ((EditText)findViewById(2131165355));
        this.ag = ((EditText)findViewById(2131165357));
        this.ah = ((TextView)findViewById(2131165245));
        this.ai = ((TextView)findViewById(2131165353));
        this.ab = ((ImageView)findViewById(2131165359));
        this.ac = ((ImageView)findViewById(2131165360));
        this.ad = ((ImageView)findViewById(2131165361));
        a(3);
        this.ab.setOnTouchListener(this.cN);
        this.ac.setOnTouchListener(this.cN);
        this.ad.setOnTouchListener(this.cN);
        this.ac.setOnClickListener(new ah(this));
        this.ad.setOnClickListener(new ai(this));
        this.ab.setOnClickListener(new ak(this));
        ((ImageView)findViewById(2131165350)).setOnClickListener(new al(this));
        ((ImageView)findViewById(2131165348)).setOnClickListener(new am(this));
        this.cq = this.cw.a("db_v");
        if (this.cq.equals(""))
          this.cq = "8";
        i1 = Integer.valueOf(this.cq).intValue();
        paramBundle = this.cw.a("default_id");
        if (!(paramBundle.equals("")))
          this.bq = Integer.valueOf(paramBundle).intValue();
        if (!(this.cw.a("isFirst").equals("NO")))
          break label3138;
        i2 = 0;
        this.L = i2;
        if (this.L)
          this.cw.a("is_vibrate", "1");
        if ((d) && (this.L))
        {
          paramBundle = new File("/data/data/com.SunSoft.PhoneRemoteControl/databases/temp_save.dat");
          if (paramBundle.exists())
            paramBundle.delete();
          a("Test", "study_vision del db!");
        }
        if ((this.c <= i1) && (((this.c != i1) || (!(this.L)))))
          break label3144;
        paramBundle = new File("/data/data/com.SunSoft.PhoneRemoteControl/databases/temp_save.dat");
        if (paramBundle.exists())
          paramBundle.delete();
        a("Test", "first run del db!");
        this.cw.a("db_v", String.valueOf(this.c));
        label3216: label3234: label3247: label3260: label3138: label3144: label3296: label3302: label3308: label3182: label3320: this.A = new e(getBaseContext());
      }
    }
    catch (IOException paramBundle)
    {
      try
      {
        this.A.a();
        this.co = this.A.getWritableDatabase();
        this.B = new f(getBaseContext());
      }
      catch (IOException paramBundle)
      {
        try
        {
          this.B.a();
          this.cp = this.B.getWritableDatabase();
          if (this.cw.a("is_mono").equals("1"))
          {
            this.bz = d("sstart.tsg");
            this.bA = d("end.tsg");
            this.bC = (this.bA.length() / 2);
            this.bB = new byte[this.bC];
            i1 = 0;
            if (i1 < this.bC)
              break label3182;
            n();
            l();
            b(1);
            b();
            a("Test", "main Soft start!");
            MyApplication.a().a(this);
            this.cv = new MediaPlayer();
            this.cv.setOnCompletionListener(new an(this));
            ((TelephonyManager)getSystemService("phone")).listen(new cy(this, 0), 32);
            if (!(this.cw.a("is_rotray").equals("1")))
              break label3216;
            this.aK.setImageResource(2130837635);
            setRequestedOrientation(9);
            this.Q = this.cw.a("is_vibrate").equals("1");
            if (!(this.cw.a("is_vibrate").equals("1")))
              break label3234;
            this.aL.setImageResource(2130837635);
            if (!(this.cw.a("is_mono").equals("1")))
              break label3247;
            this.aM.setImageResource(2130837635);
            String str = this.cw.a("download_type");
            paramBundle = str;
            if (str.equals(""))
              paramBundle = "0";
            this.bH = Integer.valueOf(paramBundle).intValue();
            if (this.bH > 2)
              this.bH = 0;
            if (this.bH == 0)
              this.aO.setImageResource(2130837632);
            if (this.bH == 1)
              this.aO.setImageResource(2130837635);
            if (this.bH == 2)
              this.aO.setImageResource(2130837634);
            a("Test", Build.MODEL);
            a("Test", Build.VERSION.RELEASE);
            a("Test", String.valueOf(Build.VERSION.SDK_INT));
            paramBundle = this.cw.a("save_device");
            a("Test", "get_device:" + paramBundle);
            if (!(paramBundle.equals("")))
              break label3260;
            this.ck = 0;
            this.cw.a("save_device", String.valueOf(this.ck));
            this.aS.setText(this.ch[this.ck]);
            if (this.ck <= 0);
          }
        }
        catch (IOException paramBundle)
        {
          try
          {
            while (this.ck == 3)
            {
              while (true)
              {
                while (true)
                {
                  while (true)
                  {
                    while (true)
                    {
                      while (true)
                      {
                        while (true)
                        {
                          while (true)
                          {
                            while (true)
                            {
                              while (true)
                              {
                                while (true)
                                {
                                  while (true)
                                  {
                                    while (true)
                                    {
                                      ci = new g();
                                      if (this.ck == 0)
                                      {
                                        this.G = true;
                                        paramBundle = new IntentFilter();
                                        paramBundle.addAction("android.intent.action.HEADSET_PLUG");
                                        MyApplication.a().b = false;
                                        if ((this.cw.a("is_soft_disconnect").equals("1")) && (!(MyApplication.a().a)))
                                        {
                                          MyApplication.a().c = true;
                                          if (this.cw.a("is_has_mic").equals("1"))
                                            MyApplication.a().b = true;
                                        }
                                        MyApplication.a().l = registerReceiver(this.cJ, paramBundle);
                                        paramBundle = MyApplication.a();
                                        if (paramBundle.l == null)
                                          break label3308;
                                        if (paramBundle.l.getIntExtra("state", 0) <= 0)
                                          break label3296;
                                        i2 = 1;
                                        paramBundle.a = i2;
                                        MyApplication.a("Test", "is_handset_connected:" + String.valueOf(paramBundle.a));
                                        MyApplication.a("Test", "name:" + paramBundle.l.getStringExtra("name"));
                                        if (paramBundle.a)
                                        {
                                          if (paramBundle.l.getIntExtra("microphone", 0) <= 0)
                                            break label3302;
                                          i2 = 1;
                                          paramBundle.b = i2;
                                        }
                                        MyApplication.a("Test", "microphone:" + String.valueOf(paramBundle.b));
                                        paramBundle.f = false;
                                        paramBundle.e = false;
                                        paramBundle.d = false;
                                        a("Test", "get_is_soft_disconnect:" + String.valueOf(this.cw.a("is_soft_disconnect")));
                                        if (this.cr.isMusicActive())
                                          Toast.makeText(this, getString(2131099701), 0).show();
                                        if (this.cr.isWiredHeadsetOn())
                                          break label3320;
                                        if (this.L)
                                        {
                                          paramBundle = new AlertDialog.Builder(this);
                                          paramBundle.setTitle(getString(2131099872));
                                          paramBundle.setMessage(getString(2131099875));
                                          paramBundle.setPositiveButton(getString(2131099873), new az(this));
                                          paramBundle.setNeutralButton(getString(2131099874), new ba(this));
                                          paramBundle.setNegativeButton(getString(2131099655), new bb(this));
                                          this.aU = paramBundle.show();
                                        }
                                      }
                                      new Timer().schedule(new ct(this), 200L);
                                      if (this.aV)
                                        new Timer().schedule(new cs(this), 1000L);
                                      this.cz = ((Location)getApplication()).a;
                                      paramBundle = new k();
                                      paramBundle.a();
                                      paramBundle.a("bd09ll");
                                      paramBundle.c("com.baidu.location.service_v2.9");
                                      paramBundle.b("all");
                                      paramBundle.c();
                                      paramBundle.b();
                                      paramBundle.d();
                                      this.cz.a(paramBundle);
                                      this.cz.c();
                                      new Timer().schedule(new da(this), 500L, 5000L);
                                      StatConfig.setDebugEnable(true);
                                      StatService.trackCustomEvent(this, "OnCreate", new String[] { "" });
                                      return;
                                      this.aA.setText(h);
                                      this.cb = j;
                                      this.cg[0] = "Open Remote";
                                      this.cg[1] = "Modify";
                                      this.cg[2] = "Delete";
                                      this.cg[3] = "Set default";
                                      this.cg[4] = "Download to Cloud Remote";
                                      this.cg[5] = "DIY Key layout Download";
                                      this.cg[6] = "Clean Cloud Remote";
                                      this.ch[0] = "Tasogo Audio";
                                      this.ch[1] = "Tasogo Inside";
                                      this.ch[2] = "SamSung 4.4";
                                      this.ch[3] = "SamSung Old";
                                      this.ch[4] = "Xiaomi Inside";
                                      this.ch[5] = "HTC Inside";
                                      this.v = "brand_en";
                                      this.w = "name_en";
                                      this.cc = h;
                                    }
                                    paramBundle = paramBundle;
                                    paramBundle.printStackTrace();
                                    this.cn = "1.0";
                                  }
                                  this.cu = Integer.valueOf(paramBundle).intValue();
                                }
                                i2 = 1;
                              }
                              this.c = i1;
                            }
                            paramBundle = paramBundle;
                            paramBundle.printStackTrace();
                          }
                          paramBundle = paramBundle;
                          paramBundle.printStackTrace();
                        }
                        this.bz = d("start.tsg");
                      }
                      this.bB[i1] = (byte)Integer.parseInt(this.bA.substring(i1 * 2, i1 * 2 + 2), 16);
                      i1 += 1;
                    }
                    this.aK.setImageResource(2130837634);
                    setRequestedOrientation(1);
                  }
                  this.aL.setImageResource(2130837634);
                }
                this.aM.setImageResource(2130837634);
              }
              this.ck = Integer.valueOf(paramBundle).intValue();
            }
            ci = new b();
          }
          catch (java.lang.NoClassDefFoundError paramBundle)
          {
            while (true)
            {
              do
                while (true)
                {
                  while (true)
                  {
                    while (true)
                    {
                      while (true)
                        this.cl = false;
                      i2 = 0;
                    }
                    i2 = 0;
                  }
                  MyApplication.a("Test", "HandsetStatus:null");
                }
              while (!(this.L));
              e();
            }
          }
        }
      }
    }
  }

  protected Dialog onCreateDialog(int paramInt)
  {
    switch (paramInt)
    {
    default:
      return null;
    case 1:
    }
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setTitle(this.z);
    localBuilder.setPositiveButton(getString(2131099653), new ao(this));
    return localBuilder.create();
  }

  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    if (this.C)
    {
      paramMenu.add(0, 7, 7, "关于");
      paramMenu.add(0, 8, 8, "退出");
      paramMenu.add(0, 9, 9, "下载测试遥控");
      if (d)
        paramMenu.add(0, 10, 10, "查找遥控");
    }
    while (true)
    {
      return true;
      paramMenu.add(0, 10, 10, "删除全部遥控");
      continue;
      paramMenu.add(0, 7, 7, "About");
      paramMenu.add(0, 8, 8, "Exit");
      paramMenu.add(0, 9, 9, "Download test");
      paramMenu.add(0, 10, 10, "Delete all remotes");
    }
  }

  protected void onDestroy()
  {
    if (this.cv != null)
      this.cv.release();
    if (this.cp != null)
      this.cp.close();
    if (this.co != null)
      this.co.close();
    if (this.G)
      unregisterReceiver(this.cJ);
    super.onDestroy();
    a(findViewById(2131165283));
    System.gc();
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    if (paramInt == 4)
    {
      if (!(this.K))
      {
        Toast.makeText(this, getString(2131099755), 0).show();
        this.K = true;
        new Timer().schedule(new cq(this), 2000L);
        return true;
      }
      this.H = true;
      finish();
      return true;
    }
    if (paramInt == 24)
    {
      this.ct = this.cr.getStreamVolume(3);
      this.cu = this.ct;
      this.cu += 1;
      if (this.cu > this.cu)
        this.cu = this.cs;
      if ((this.cu < this.cs - 1) && (!(k)))
        this.cu = (this.cs - 1);
      this.cr.setStreamVolume(3, this.cu, 1);
      this.cw.a("save_vol", String.valueOf(this.cu));
      a("Test", "currentVolume:" + String.valueOf(this.ct));
      k();
      return true;
    }
    if (paramInt == 25)
    {
      this.ct = this.cr.getStreamVolume(3);
      this.cu = this.ct;
      this.cu -= 1;
      if (this.cu <= 2)
        this.cu = 2;
      if ((this.cu < this.cs - 1) && (!(k)))
        this.cu = (this.cs - 1);
      this.cr.setStreamVolume(3, this.cu, 1);
      this.cw.a("save_vol", String.valueOf(this.cu));
      a("Test", "currentVolume:" + String.valueOf(this.ct));
      k();
      return true;
    }
    return super.onKeyDown(paramInt, paramKeyEvent);
  }

  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    if (paramMenuItem.getItemId() == 7)
    {
      if (!(d))
        break label352;
      if (!(m()))
        break label338;
      Toast.makeText(this, "文件拷贝成功", 0).show();
    }
    if (paramMenuItem.getItemId() == 8)
    {
      if (!(d))
        break label359;
      new AlertDialog.Builder(this).setTitle(this.cb).setMessage("是否确认要删除数据文件?此操作不可恢复!").setNegativeButton(getString(2131099654), new bv(this)).setPositiveButton(getString(2131099653), new bw(this)).show();
    }
    if (paramMenuItem.getItemId() == 9)
    {
      this.an = new ArrayList();
      this.an.add(new BasicNameValuePair("txtUser_name", "tasotest"));
      this.an.add(new BasicNameValuePair("txtPassword", "4321"));
      this.an.add(new BasicNameValuePair("action_value", "check"));
      this.bj = 19;
      this.ba = 13;
      this.bb = "http://www.tasogo.com/user_control.aspx";
      localObject = new Message();
      ((Message)localObject).what = 5;
      this.ca.sendMessage((Message)localObject);
      this.aZ = true;
    }
    if (paramMenuItem.getItemId() == 10)
    {
      if (d)
        break label395;
      if (!(this.C))
        break label388;
    }
    label388: for (paramMenuItem = "是否确定要删除全部遥控,此操作将不可恢复!"; ; paramMenuItem = "Are you sure to delete all remotes?")
      while (true)
      {
        while (true)
        {
          while (true)
          {
            new AlertDialog.Builder(this).setTitle(this.cb).setMessage(paramMenuItem).setNegativeButton(getString(2131099654), new bx(this)).setPositiveButton(getString(2131099653), new by(this)).show();
            return true;
            label338: Toast.makeText(this, "文件复制失败!!", 0).show();
          }
          label352: d();
        }
        label359: this.H = true;
        Toast.makeText(this, getString(2131099679), 0).show();
        MyApplication.a().b();
      }
    label395: paramMenuItem = LayoutInflater.from(this).inflate(2130903055, null);
    Object localObject = (EditText)paramMenuItem.findViewById(2131165228);
    paramMenuItem.findViewById(2131165245);
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setTitle("查找遥控数据");
    localBuilder.setIcon(17301659);
    localBuilder.setView(paramMenuItem);
    ((EditText)localObject).setText(this.bG);
    localBuilder.setPositiveButton("查找", new cj(this, (EditText)localObject));
    localBuilder.setNegativeButton(getString(2131099654), new ck(this));
    localBuilder.show();
    return true;
  }

  protected void onPause()
  {
    this.H = true;
    this.M = 200;
    if (this.cv != null)
      this.cv.reset();
    super.onPause();
  }

  protected void onRestart()
  {
    this.H = false;
    super.onRestart();
  }

  protected void onResume()
  {
    this.H = false;
    this.M = 0;
    if ((this.cu < this.cs - 1) && (!(k)))
      this.cu = (this.cs - 1);
    this.cr.setStreamVolume(3, this.cu, 0);
    a("Test", "Set Volume:" + String.valueOf(this.ct));
    if (!(d))
      b();
    Object localObject = new Message();
    ((Message)localObject).what = 11;
    this.ca.sendMessage((Message)localObject);
    localObject = new Message();
    ((Message)localObject).what = 27;
    this.ca.sendMessage((Message)localObject);
    localObject = this.cw.a("con_id");
    if ((localObject != null) && (!(((String)localObject).equals(""))))
    {
      int i1 = Integer.valueOf((String)localObject).intValue();
      if (i1 > 0)
      {
        localObject = new Intent(this, Show_Control.class);
        ((Intent)localObject).putExtra("con_id", String.valueOf(i1));
        if (!(d))
          break label427;
        ((Intent)localObject).putExtra("do_type", "2");
        startActivity((Intent)localObject);
      }
    }
    if (MyApplication.a().i)
    {
      MyApplication.a().i = false;
      this.y = 1;
      a();
      a(true);
    }
    if ((this.p != null) && (!(MyApplication.a().n.equals(""))))
      if (this.q != null)
      {
        if (!(this.C))
          break label441;
        this.q.setText(MyApplication.a().n);
        this.r.setText(MyApplication.a().o);
      }
    while (true)
    {
      while (true)
      {
        if ((this.o) && (d))
        {
          this.s.setText(MyApplication.a().n + this.cy[this.n].c);
          this.t.setText(MyApplication.a().o + " " + this.cy[this.n].d);
        }
        MyApplication.a().n = "";
        super.onResume();
        return;
        label427: ((Intent)localObject).putExtra("do_type", "0");
      }
      label441: this.r.setText(MyApplication.a().n);
      this.q.setText(MyApplication.a().o);
    }
  }

  protected void onStart()
  {
    this.H = false;
    super.onStart();
  }

  protected void onStop()
  {
    this.H = true;
    super.onStop();
  }
}